function formatNumber(val: any) {
  if (!val) return;
  //从做向右每隔三位去加一个，
  return `${val}`.replace(/(\d{3})(?=\d)/g, '$1,')

}
export default function useFormat() {
  //对数字操作
  const numberFormat = (val: any) => formatNumber(val)
  //对钱
  const moneyFormat=(val:any)=>`￥${formatNumber(val)}`
  return {
    numberFormat,
    moneyFormat
}


}